﻿using Abp.EntityFramework;
using LLR.LearnAbp.IRepositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LLR.LearnAbp.EntityFramework.Repositories
{
    public class BackendTaskRepository : LearnAbpRepositoryBase<Entities.Task>, IBackendTaskRepository
    {
        public BackendTaskRepository(IDbContextProvider<LearnAbpDbContext> dbContextProvider) : base(dbContextProvider)
        {

        }
        public List<Entities.Task> GetTaskByAssignedPersonId(long personId)
        {
            var query = GetAll();
            if (personId>0)
            {
                query.Where(t => t.AssignedPersonId == personId);
            }
            return query.ToList();
        }
    }
}
